
import * as Hapi from '@hapi/hapi';
const init = async () => {
  const server = Hapi.server({
      port: 3000,
      host: 'localhost'
  });

  server.route({
      method: 'GET',
      path: '/',
      handler: (request, h) => {
          return 'Hello, HAPI!';
      }
  });

  await server.start();
  console.log(`Server running at: ${server.info.uri}`);
};

process.on('unhandledRejection', (err) => {
  console.log(err);
  process.exit(1);
});

init();